﻿using System.Configuration;

namespace ERP.Framework.Components.ConfigurationHelper.CustomSettings
{
    /// <summary>
    /// Represent DatabaseConfigurationSettings section in config file
    /// </summary>
    public sealed class DatabaseConfigurationSettings : ConfigurationSection
    {
        #region Properties

        /// <summary>
        /// Gets the settings.
        /// </summary>
        /// <value>The settings.</value>
        internal static DatabaseConfigurationSettings Settings
        {
            get
            {
                return System.Configuration.ConfigurationManager.GetSection("DatabaseConfigurationSettings") as DatabaseConfigurationSettings;
            }
        }

        /// <summary>
        /// Gets or sets the databases.
        /// </summary>
        /// <value>The databases.</value>
        [ConfigurationProperty("Databases", IsDefaultCollection = true)]
        [ConfigurationCollection(typeof(DatabaseConfigurationEntryCollection))]
        public ConfigurationHelper.DatabaseConfigurationEntryCollection Databases
        {
            get
            {
                return base["Databases"] as DatabaseConfigurationEntryCollection;
            }
            set
            {
                base["Databases"] = value;
            }
        }

        #endregion
    }
}
